import { createPinia } from "pinia";
import { createPersistedState } from "./plugins";

const pinia = createPinia();

// sessionStorage
// pinia.use(
// 	createPersistedState({
// 		stroage: window.sessionStorage,
// 		reducer: [""],
// 	}),
// );

// localStorage
// pinia.use(createPersistedState());

export { defineStore } from "pinia";

// modules
export { default as useUserStore } from "./module/user";
export { default as useSettingStore } from "./module/setting";

export type {
	PiniaPluginContext,
	StateTree,
	DefineSetupStoreOptions,
	DefineStoreOptionsBase,
	DefineStoreOptions,
	Store,
	Pinia,
} from "pinia";

export default pinia;
